﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SEVN.Web.Framework.Modules.News
{
    public partial class New0401 : System.Web.UI.UserControl
    {
        WebFrameDataContext wf = new WebFrameDataContext();
        protected void Page_Load(object sender, EventArgs e)
        {
            var listNews = from x in wf.Newsletters
                           orderby x.CreateDate descending
                           where x.CreateDate <= DateTime.Now.AddMonths(-1)
                           select x;

            RptNews.DataSource = listNews.Take(5);
            RptNews.DataBind();
        }

    }
}